import { instance as request } from '../request'

/**
 * 创建笔记
 * @param data
 * @returns
 */
export const createNoteApi = (data: createNoteItf): PromiseRes =>
  request.post('/note/create', data)

/**
 * 更新笔记
 * @param data
 * @returns
 */
export const updateNoteApi = (data: updateNoteItf): PromiseRes =>
  request.put('/note/update', data)

/**
 * 删除笔记
 * @param id  笔记id
 * @returns
 */
export const deleteNoteApi = (id: string): PromiseRes =>
  request.delete(`/note/delete/${id}`)

/**
 * 获取笔记id
 * @param id 笔记id
 * @returns
 */
export const getNoteDetailApi = (id: string): PromiseRes<getNoteResultItf> =>
  request.get(`/note/detail/${id}`)
